package online.sixfish.question.controller;

import online.sixfish.common.pojo.Message;
import online.sixfish.common.pojo.State;
import online.sixfish.question.service.RecordServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author 凯威
 */
@CrossOrigin
//@RestController
public class RecordController {

    @Autowired
    private RecordServer recordServer;
//
//    @Autowired
//    private WekaServiceImpl wekaService;

    @GetMapping("/getSubmitRecords/{uid}/{qid}/{page}")
    public Object getSubmitRecordsWithUidAndQid(@PathVariable long uid,@PathVariable long qid,@PathVariable int page){
        return new Message(State.SUCCESS,recordServer.getSubmitRecordList(uid,qid,page),"获取成功!");
    }
    @GetMapping("/getSubmitRecordsWithQid/{qid}/{page}")
    public Object getSubmitRecordsWithQid(@PathVariable long qid,@PathVariable int page){
        return new Message(State.SUCCESS,recordServer.getSubmitRecordList(qid,page),"获取成功!");
    }

    @GetMapping("/getSubmitRecordsWithUid/{uid}/{page}")
    public Object getSubmitRecordsWithUid(@PathVariable long uid,@PathVariable int page){
        return new Message(State.SUCCESS,recordServer.getSubmitRecordListWithUid(uid,page),"获取成功!");
    }

//    @GetMapping("/getMatchSubmitCluster/{mid}")
//    public Object getMatchSubmitCluster(@PathVariable long mid){
//        return new Message(State.SUCCESS,wekaService.calculate(mid),"操作成功！");
//    }

}
